package com.yj.ccs.abs.common.service;

import com.yj.ccs.abs.common.entity.Area;
import com.yj.ccs.abs.common.entity.City;
import com.yj.ccs.abs.common.entity.Province;
import com.yj.ccs.abs.common.entity.Region;
import com.yj.ccs.abs.common.mapper.RegionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Copyright 2018 (C) Yunjian-VC
 * Created on : 2018/3/15
 * Author     : Unbelievable9
 **/
@Service
public class RegionService {

    @Autowired
    RegionMapper regionMapper;

    public Area getAreaByCode(String code) {
        return regionMapper.getAreaByCode(code);
    }

    public List<Province> getAllProvinces() {
        return regionMapper.getAllProvinces();
    }

    public List<City> getAllCitiesByProvinceCode(String code) {
        return regionMapper.getAllCitiesByProvinceCode(code);
    }

    public List<Area> getAllAreasByCityCode(String code) {
        return regionMapper.getAllAreasByCityCode(code);
    }

    public Region getRegionByAreaCode(String code) {
        return regionMapper.getRegionByAreaCode(code);
    }
}
